using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace HRM.Models.Mapping
{
    public class NhomNguoiDungMap : EntityTypeConfiguration<NhomNguoiDung>
    {
        public NhomNguoiDungMap()
        {
            // Primary Key
            this.HasKey(t => t.MaNNDung);

            // Properties
            this.Property(t => t.MaNNDung)
                .IsRequired()
                .HasMaxLength(10);

            this.Property(t => t.TenNNDung)
                .HasMaxLength(100);

            // Table & Column Mappings
            this.ToTable("NhomNguoiDung");
            this.Property(t => t.MaNNDung).HasColumnName("MaNNDung");
            this.Property(t => t.TenNNDung).HasColumnName("TenNNDung");
        }
    }
}
